package com.dsg.service.Impl;

import com.dsg.entity.Customer;
import com.dsg.entity.Customertype;
import com.dsg.entity.Kehustart;
import com.dsg.entity.Staff;
import com.dsg.mappers.CustomerMapper;
import com.dsg.service.CustomerService;
import com.dsg.vo.CustomerDto;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service("customerService")
public class CustomerServiceImpl implements CustomerService {
    @Resource
    private CustomerMapper customerMapper;

    @Override
    public List<Customer> seachAll(CustomerDto customerDto) {
        return customerMapper.findAll(customerDto);
    }

    @Override
    public List<Kehustart> seachAllType() {
        return customerMapper.findAlltype();
    }

    @Override
    public List<Customertype> seachleixing() {
        return customerMapper.findleixing();
    }

    @Override
    public int update(Customer customer) {
        int i= customerMapper.update(customer);
        return i;
    }

    @Override
    public Integer add(Customer customer) {
        return customerMapper.add(customer);
    }

    @Override
    public void batchDel(Integer[] ids) {
         customerMapper.batchDel(ids);
    }

    @Override
    public List<Staff> seachAllYg() {
        return customerMapper.findYuangong();
    }

    @Override
    public int updateStaff(Customer customer) {
        return customerMapper.updateStaff(customer);
    }
}
